nip52: add NIP-52 Calendar Events support#1283
Draft
ozgb wants to merge 8 commits into
Draft
Conversation
Add support for NIP-52 (Calendar Events) with four event kinds: - DateBasedCalendarEvent (31922) - TimeBasedCalendarEvent (31923) - Calendar (31924) - CalendarEventRsvp (31925) Includes new TagKind variants (Start, End, Location), a Location TagStandard variant, and full tag round-trip conversion for all four structs with validation and tests. Closes rust-nostr#829
… author) - Add uppercase D tags to TimeBasedCalendarEvent for day-granularity relay filtering - Change location from Option<String> to Vec<String> (spec says "repeated") - Add optional author (p tag) to CalendarEventRsvp for event author pubkey - Clean up RSVP deserialization to use Option instead of placeholder Coordinate
- M1: clarify `coordinates` doc comments as optional - M2: validate YYYY-MM-DD format for DateBasedCalendarEvent start/end - M4: return InvalidTimestamp instead of misleading StartMissing - m3: document that event description lives in Nostr event content field - m4: implement std::error::Error behind std feature flag - Add tests for date validation, invalid timestamps, and error paths
- Add EventBuilder convenience methods for all 4 NIP-52 event kinds - Replace Vec::new() with Vec::with_capacity() in tag serialization - Remove std::error::Error impl to match NIP-53 consistency - Fix RSVP status/FreeBusy parsing to return errors instead of silently skipping - Add comments explaining uppercase:false match arms - Add tests for multi-day D tags, RSVP with all fields, calendar with multiple coordinates, and unknown RSVP status error
…, add coverage gaps
Author
Thanks @TheAwiteb - is that issue being worked on? I can try to resolve it if not - I saw you were working on it but unassigned yourself a couple of weeks ago |
Member
Not yet, but Yuki will work on it soon, around the next week. Thank you |
3 tasks
3 tasks
3 tasks
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dtag, repeatable locations/participants, geohash, and RSVP validationTest plan
cargo testpassescargo clippyclean